package com.twh.www.controller;

import com.twh.www.entity.WnGoods;
import com.twh.www.service.MinioService;
import com.twh.www.service.WnGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@Controller
public class GoodsController {

    @Autowired
    private WnGoodsService wnGoodsService;


    @GetMapping("/goods/{id}")
    public String goodsDetail(@PathVariable Integer id, Model model) {
        WnGoods goods = wnGoodsService.getById(id);

        model.addAttribute("goods", goods);
        return "goods_view"; // /WEB-INF/pages/goods_view.jsp
    }

}